/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  Platform,
  StyleSheet,
  Text,
  View,
  Button
} from 'react-native';

export default class HomePage extends Component{
  render() {
   const { navigation } = this.props;
    const itemId = navigation.getParam('itemId', 'NO-ID');
    const otherParam = navigation.getParam('otherParam', 'some default value');
    
    return (
      <View style={styles.container}>
      <Text>ItemId:{JSON.stringify(itemId)}</Text>
      <Text>Others:{JSON.stringify(otherParam)}</Text>
        <Text style={styles.welcome}>
         用户界面
        </Text>
        <Button
          title="跳转到第二个页面"
          onPress={()=>this.props.navigation.push('ComPage')}
        ></Button>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});
